package cn.dnuihyy406.dnuifood_16110100406.model;

import cn.dnuihyy406.dnuifood_16110100406.iface.UserImformationIface;
import cn.dnuihyy406.dnuifood_16110100406.listener.OnRetrofitListener;
import cn.dnuihyy406.dnuifood_16110100406.service.UserImformationService;
import retrofit2.Call;

public class UserImformationModel extends BaseModel implements UserImformationIface {
    private UserImformationService userImformationService;
    public UserImformationModel(){
        super();
        userImformationService=retrofit.create(UserImformationService.class);
    }

    @Override
    public void updateUserById(String user_id, String username, String userpass, String mobilenum, String address, OnRetrofitListener listener) {
        Call call =userImformationService.updateUserById(user_id,username,userpass,mobilenum,address);
        bindCallBack(call,listener,11);
    }

    @Override
    public void getUserById(String user_id, OnRetrofitListener listener) {
        Call call =userImformationService.getUserById(user_id);
        bindCallBack(call,listener,12);
    }

    @Override
    public void getAllOrdersByUser(String user_id, OnRetrofitListener listener) {
        Call call =userImformationService.getAllOrdersByUser(user_id);
        bindCallBack(call,listener,13);
    }

    @Override
    public void getAllCommentsByUser(String user_id, OnRetrofitListener listener) {
        Call call =userImformationService.getAllCommentsByUser(user_id);
        bindCallBack(call,listener,14);
    }

    @Override
    public void updateComment(String item_id, String content, OnRetrofitListener listener) {
        Call call =userImformationService.updateComment(item_id,content);
        bindCallBack(call,listener,15);
    }

    @Override
    public void deleteComment(String item_id, OnRetrofitListener listener) {
        Call call =userImformationService.deleteComment(item_id);
        bindCallBack(call,listener,16);
    }
}

